<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../print.css" type="text/css" media="print">
<meta content="SelectionController,com.developmentarc.core.controllers.SelectionController,addItem,clearAllGroups,deselectAll,generateNewId,getAllItemsInGroup,getItemGroup,getSelected,removeAllItems,removeItem,selectAll,selectItem" name="keywords">
<title>com.developmentarc.core.controllers.SelectionController</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'SelectionController - DevelopmentArc Core API Documentation';
				var baseRef = '../../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">DevelopmentArc Core API</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../index-list.html')" href="../../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../../index.html?com/developmentarc/framework/controllers/SelectionController.html&amp;com/developmentarc/framework/controllers/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;SelectionController</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class SelectionController"); titleBar_setSubNav(false,false,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">com.developmentarc.core.controllers</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class SelectionController</td>
</tr>
</table>
<p></p>
  Provides a set of controls that allows any object that implement ISelectable to behave
  as a selection group.  This Controller allows a you to generate a group id and then
  group ISelectable items using this id value.  Once a group has been defined a you can then
  select a single item in the group and the other items will be deselected similarlary to a
  radio group, you can deselect all items or select items when using mutliple select.
  
  <p>Items can be selected outside of the SelectionController and the selection of other items
  will not be modified unless the selection action is made through the SelectionController. This
  allows developers to create multi-selectable groupings and only when the selection of a specific
  item, group deselection or group selection is required should the SelectionController be used.</p>
   
  <p></p>
<br>
<hr>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addItem()">addItem</a>(item:<a href="interfaces/ISelectable.html">ISelectable</a>, groupId:int):void</div>
<div class="summaryTableDescription">[static]
   Adds a Selectable item to a specificed group id.</div>
</td><td class="summaryTableOwnerCol">SelectionController</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#clearAllGroups()">clearAllGroups</a>():void</div>
<div class="summaryTableDescription">[static]
   This method removes all items and groups from the SelectionController.</div>
</td><td class="summaryTableOwnerCol">SelectionController</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#deselectAll()">deselectAll</a>(group:int):void</div>
<div class="summaryTableDescription">[static]
   Used to deselect all items in a selection group.</div>
</td><td class="summaryTableOwnerCol">SelectionController</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#generateNewId()">generateNewId</a>():int</div>
<div class="summaryTableDescription">[static]
   Used to generate a unique group id.</div>
</td><td class="summaryTableOwnerCol">SelectionController</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getAllItemsInGroup()">getAllItemsInGroup</a>(group:int):Array</div>
<div class="summaryTableDescription">[static]
   Returns a list of items that are members of the provided group.</div>
</td><td class="summaryTableOwnerCol">SelectionController</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getItemGroup()">getItemGroup</a>(item:<a href="interfaces/ISelectable.html">ISelectable</a>):int</div>
<div class="summaryTableDescription">[static]
   Returns the specified item's group id number.</div>
</td><td class="summaryTableOwnerCol">SelectionController</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getSelected()">getSelected</a>(groupId:int):Array</div>
<div class="summaryTableDescription">[static]
   Method returns an array of all currently selected items in the specified group.</div>
</td><td class="summaryTableOwnerCol">SelectionController</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#removeAllItems()">removeAllItems</a>(groupId:int):void</div>
<div class="summaryTableDescription">[static]
   Removes all the items and the group id from the controller.</div>
</td><td class="summaryTableOwnerCol">SelectionController</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#removeItem()">removeItem</a>(item:<a href="interfaces/ISelectable.html">ISelectable</a>):void</div>
<div class="summaryTableDescription">[static]
   Removes the item from the manager and the boung group.</div>
</td><td class="summaryTableOwnerCol">SelectionController</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#selectAll()">selectAll</a>(group:int):void</div>
<div class="summaryTableDescription">[static]
   Used to select all the items within a selection group.</div>
</td><td class="summaryTableOwnerCol">SelectionController</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#selectItem()">selectItem</a>(item:<a href="interfaces/ISelectable.html">ISelectable</a>):void</div>
<div class="summaryTableDescription">[static]
   Sets the selected property for the specified item and deselects any other items 
   within the same group as the specified item.</div>
</td><td class="summaryTableOwnerCol">SelectionController</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="addItem()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addItem</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public static function addItem(item:<a href="interfaces/ISelectable.html">ISelectable</a>, groupId:int):void</code><p>
   Adds a Selectable item to a specificed group id.  The group id should be a unique id that 
   defines the group the item belongs to. Use the generateNewId() method on this class to 
   generate a unique that the id which is not in use within the manager.
   
   </p><p>If an item is already assigne to a group id this method will remove the item from the
   previous group and re-assign the item to a new group.  Items can only be assigned to one
   group id within the SelectionController.</p>
    
   <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">item</span>:<a href="interfaces/ISelectable.html">ISelectable</a></code> &mdash; The item to add to the group.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">groupId</span>:int</code> &mdash; The group id to add the item to.
   
   </td>
</tr>
</table>
</div>
<a name="clearAllGroups()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">clearAllGroups</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function clearAllGroups():void</code><p>
   This method removes all items and groups from the SelectionController.  This
   method is considered a full reset and removes all references and group ids
   from the instance. 
   
   </p></div>
<a name="deselectAll()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">deselectAll</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function deselectAll(group:int):void</code><p>
   Used to deselect all items in a selection group. This
   method sets the selected value on all the group items to false.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">group</span>:int</code></td>
</tr>
</table>
</div>
<a name="generateNewId()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">generateNewId</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function generateNewId():int</code><p>
   Used to generate a unique group id.  This should be called when creating a new g
   rouping to verify that the provided id is unique in the system.
    
   </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>int</code> &mdash; A unique generated group id. 
   
   </td>
</tr>
</table>
</div>
<a name="getAllItemsInGroup()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getAllItemsInGroup</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function getAllItemsInGroup(group:int):Array</code><p>
   Returns a list of items that are members of the provided group.
   This is a cloned array of the internal list and modifying the order
   or content of the Array will not affect group membership or order.
   If the provided group id is not used or found then an empty Array
   is returned.
    
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">group</span>:int</code> &mdash; The group id to lookup.
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Array</code> &mdash; The list of ISelectable items bound to the provided group.
   
   </td>
</tr>
</table>
</div>
<a name="getItemGroup()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getItemGroup</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function getItemGroup(item:<a href="interfaces/ISelectable.html">ISelectable</a>):int</code><p>
   Returns the specified item's group id number.  This method looks
   up the item in the SelectionController and provides the group id
   that is currently assigned to an item.  If the item is not being
   tracked / assigned to a group id then the value -1 is returned which
   represents no group id.
    
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">item</span>:<a href="interfaces/ISelectable.html">ISelectable</a></code> &mdash; Item to look group up on.
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>int</code> &mdash; The group the item is a member of.
   
   </td>
</tr>
</table>
</div>
<a name="getSelected()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getSelected</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function getSelected(groupId:int):Array</code><p>
   Method returns an array of all currently selected items in the specified group.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">groupId</span>:int</code> &mdash; group id.
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Array</code> &mdash; An Array containing all items currently selected.
   </td>
</tr>
</table>
</div>
<a name="removeAllItems()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">removeAllItems</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function removeAllItems(groupId:int):void</code><p>
   Removes all the items and the group id from the controller.
    
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">groupId</span>:int</code> &mdash; The group to remove the items from.
   
   </td>
</tr>
</table>
</div>
<a name="removeItem()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">removeItem</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function removeItem(item:<a href="interfaces/ISelectable.html">ISelectable</a>):void</code><p>
   Removes the item from the manager and the boung group.  If the item is the 
   last of the group, the group is removed from the SelectionController and is
   no longer considered a valid group id.  The group id can be re-used when calling
   addItem() but verify that the no other items are assigned to the group at the
   time of reuse.
    
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">item</span>:<a href="interfaces/ISelectable.html">ISelectable</a></code> &mdash; The item to remove from the group.
   
   </td>
</tr>
</table>
</div>
<a name="selectAll()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">selectAll</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function selectAll(group:int):void</code><p>
   Used to select all the items within a selection group. This 
   method sets the selected value on all the group items to true.
    
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">group</span>:int</code> &mdash; The selection group to select.
   
   </td>
</tr>
</table>
</div>
<a name="selectItem()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">selectItem</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function selectItem(item:<a href="interfaces/ISelectable.html">ISelectable</a>):void</code><p>
   Sets the selected property for the specified item and deselects any other items 
   within the same group as the specified item.  This method is responsible for looking
   up the group id for the specified item.  If the item is not within a defined group
   which is being tracked by the SelectionController then only the provided item will
   be selected and the any other items in the SelectionController will be unaffected.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">item</span>:<a href="interfaces/ISelectable.html">ISelectable</a></code> &mdash; The item to select.
   
   </td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
